//
// RTSPClientSession.h
//
// $Id: //base/include/RTSPClientSession.h
//
// Library: base
// Package: RTSP
// Module : RTSPClientSession
// Author :	Jelin,doitsjz@163.com
// Date	  :	10/30/2012
// 
// Definition of the RTSPClientSession class.
//
// Copyright (c) 2012-2012, iGuard.
//


#ifndef BASE_HTTPClientSession_INCLUDED
#define BASE_HTTPClientSession_INCLUDED

/**
	RTSPClientSession class for sending RTSP Request 
	and recving RTSP Response
*/

#include "base.h"
#include "BaseHTTPSession.h"

using namespace std;

class BASE_API BaseHTTPClientSession: public BaseHTTPSession
{
public:
	//BaseHTTPClientSession(string &strURL);
	BaseHTTPClientSession();
	~BaseHTTPClientSession();
protected:
//	int handleMessage(RTSPMessage* pMessage);
	virtual int handleMessage(BaseHTTPRequest& request);
	virtual int handleMessage(BaseHTTPResponse& reply);

protected:
	//deal with reply from server,Client side,S->C
    virtual void OnReply(int status,BaseHTTPResponse& reply){};

public:
	int makeGetRequest(string& url,string& body,string& req);
	int makePostRequest(string& url,string& body,string& req);
	int makePutRequest(string& url,string& body,string& req);
	int makeDeleteRequest(string& url,string& body,string& req);
private:
	int makeRequest(const string& method,string& url,string& body,string& req);
};

#endif